package com.lizhen.core.method;

public class OrderMethod {

    public static void main(String[] args) {
        B b = new B();

        System.out.println("---");

        b = new B();
    }

    static class A {
        private static int numA;

        static {
            System.out.println("A的静态字段 : " + numA);
            System.out.println("A的静态代码块");
        }

        private int numA2;

        {
            System.out.println("A的成员变量  : " + numA2);
            System.out.println("A的非静态代码块");
        }

        public A() {
            System.out.println("A的构造器");
        }
    }

    static class B extends A {
        private static int numB;

        static {
            System.out.println("B的静态字段 : " + numB);
            System.out.println("B的静态代码块");
        }

        private int numB2;

        {
            System.out.println("B的成员变量 : " + numB2);
            System.out.println("B的非静态代码块");
        }

        public B() {
            System.out.println("B的构造器");
        }
    }

}